package com.example.carrierapp.ui.person.set;

import android.app.Dialog;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.TextView;

import com.example.carrierapp.base.BaseActivity;
import com.example.carrierapp.config.ConstValue;
import com.example.carrierapp.ui.dialog.DialogUtils;
import com.example.carrierapp.ui.person.about.AboutActivity;
import com.example.carrierapp.ui.person.help.HelpVideoActivity;
import com.example.carrierapp.util.ActivityUtil;
import com.example.carrierapp.util.AppUtil;
import com.example.carrierapp.util.SPUtils;
import com.example.lb.fingerdemo.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class SettingActivity extends BaseActivity {
    @BindView(R.id.tv_set_version)
    TextView mTvVersion;

    @Override
    public int getContentView() {
        return R.layout.activity_setting;
    }

    @Override
    public String getTitleString() {
        return "设置";
    }

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ButterKnife.bind(this);
        mTvVersion.setText("当前版本：" + AppUtil.getAppVersionName(this));
    }

    @OnClick({ R.id.tv_set_contact, R.id.tv_set_video, R.id.tv_set_about})
    public void onCLick(View v) {
        switch (v.getId()) {

            case R.id.tv_set_contact:
                Dialog dialog1 = new DialogUtils.Builder(this).setMessage("是否拨打电话?").setPositiveButton(null, null, new DialogUtils.CallbackListener() {
                    @Override
                    public void onClick(View v) {
                        AppUtil.callNumber(SettingActivity.this, ConstValue.PHONE);
                    }
                }).creat();
                dialog1.show();
                break;
            case R.id.tv_set_video:
                ActivityUtil.startActivity(this, HelpVideoActivity.class);
                break;
            case R.id.tv_set_about:
                ActivityUtil.startActivity(this, AboutActivity.class);
                break;
        }
    }

}
